<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="utf-8">
<!-- creator-debugger.qdoc -->
  <title>Troubleshooting Debugger | Qt Creator Manual</title>
  <link rel="stylesheet" type="text/css" href="style/offline-simple.css" />
  <script type="text/javascript">
    document.getElementsByTagName("link").item(0).setAttribute("href", "style/offline.css");
    // loading style sheet breaks anchors that were jumped to before
    // so force jumping to anchor again
    setTimeout(function() {
        var anchor = location.hash;
        // need to jump to different anchor first (e.g. none)
        location.hash = "#";
        setTimeout(function() {
            location.hash = anchor;
        }, 0);
    }, 0);
  </script>
</head>
<body>
<div class="header" id="qtdocheader">
  <div class="main">
    <div class="main-rounded">
      <div class="navigationbar">
        <table><tr>
<td ><a href="index.html">Qt Creator Manual</a></td><td >Troubleshooting Debugger</td></tr></table><table class="buildversion"><tr>
<td id="buildversion" width="100%" align="right"><a href="index.html">Qt Creator Manual 4.11.1</a></td>
        </tr></table>
      </div>
    </div>
<div class="content">
<div class="line">
<div class="content mainContent">
  <link rel="prev" href="creator-qml-debugging-example.html" />
  <link rel="next" href="creator-analyze-mode.html" />
<p class="naviNextPrevious headerNavi">
<a class="prevPage" href="creator-qml-debugging-example.html">Debugging a Qt Quick Example Application</a>
<span class="naviSeparator">  &#9702;  </span>
<a class="nextPage" href="creator-analyze-mode.html">Analyzing Code</a>
</p><p/>
<div class="sidebar">
<div class="toc">
<h3><a name="toc">Contents</a></h3>
<ul>
<li class="level1"><a href="#cannot-launch-debugger">Cannot Launch Debugger</a></li>
<li class="level1"><a href="#debugger-does-not-hit-breakpoints">Debugger Does Not Hit Breakpoints</a></li>
<li class="level1"><a href="#debugger-does-not-work">Debugger Does Not Work</a></li>
<li class="level1"><a href="#pointer-variable-members-are-not-displayed-directly">Pointer Variable Members Are Not Displayed Directly</a></li>
<li class="level1"><a href="#structure-members-are-not-sorted-according-to-structure-layout">Structure Members Are Not Sorted According to Structure Layout</a></li>
<li class="level1"><a href="#built-in-debugger-is-slow-during-startup-and-runtime">Built-in Debugger Is Slow During Startup and Runtime</a></li>
<li class="level1"><a href="#debugger-cannot-attach-to-running-process-on-linux">Debugger Cannot Attach to Running Process on Linux</a></li>
</ul>
</div>
<div class="sidebar-content" id="sidebar-content"></div></div>
<h1 class="title">Troubleshooting Debugger</h1>
<span class="subtitle"></span>
<!-- $$$creator-troubleshooting-debugging.html-description -->
<div class="descr"> <a name="details"></a>
<p>This section lists some typical problems that you might encounter while debugging and solutions to them.</p>
<a name="cannot-launch-debugger"></a>
<h2 id="cannot-launch-debugger">Cannot Launch Debugger</h2>
<p>Some anti-virus applications do not allow debuggers to retrieve data. For example, on Windows, launching the debugger might fail with the following message if the Avira AntiVir is installed on the development PC: <i>The inferior stopped because it received a signal from the operating system. Signal name:? signal meaning: Unknown signal.</i></p>
<p>Some versions of Avira AntiVir Desktop-Products contain known issues in various development environments, including Qt Creator. To fix the problem, Avira instructs you to update to version <code>avipbb.sys 10.0&#x2e;22.22</code>. For more information, see <a href="http://www.avira.com/en/support-for-business-knowledgebase-detail/kbid/805">Restricted Usability of IDE/Debuggers since 2010-12-08</a>.</p>
<p>On some devices, such as Wacom Tablets, running processes might stop the debugger from launching. Stop all running processes and then relaunch the debugger.</p>
<a name="debugger-does-not-hit-breakpoints"></a>
<h2 id="debugger-does-not-hit-breakpoints">Debugger Does Not Hit Breakpoints</h2>
<p>You might have created a release build that does not contain debug information. A GNU Compiler Collection (GCC) debug build has the <code>-g</code> option on the compiler command line. Check that this option is present in the <b>Compile Output</b> pane. If it is not, adjust your build settings in the <b>Projects</b> mode.</p>
<a name="debugger-does-not-work"></a>
<h2 id="debugger-does-not-work">Debugger Does Not Work</h2>
<p>If the debugger does not work properly, try the following:</p>
<ol class="1" type="1"><li>Make sure you use at least Qt Creator 3.0&#x2e;1</li>
<li>Make sure the debugger is set up properly. For more information, see <a href="creator-debugger-engines.html">Setting Up Debugger</a>.</li>
<li>In the <b>Debug</b> mode, select <b>Window</b> &gt; <b>Views</b> &gt; <b>Debugger Log</b> to open the <b>Debugger Log</b> view. Browse the contents of the pane on the right hand side to find out what went wrong. Always attach the contents of the pane to debugger-related questions to the Qt Creator mailing list (qt-creator@trolltech.com) or paste them to <a href="http://creator.pastebin.com">creator.pastebin.com</a> before asking questions in the IRC (on the #qt-creator channel at FreeNode).</li>
</ol>
<a name="pointer-variable-members-are-not-displayed-directly"></a>
<h2 id="pointer-variable-members-are-not-displayed-directly">Pointer Variable Members Are Not Displayed Directly</h2>
<p>When you use the <b>Locals</b> and <b>Expressions</b> views to inspect a pointer variable and expand the variable tree item, another tree item level is displayed. To directly display the members of the pointer variable, select <b>Dereference Pointers Automatically</b> in the context menu in the <b>Locals</b> and <b>Expressions</b> views.</p>
<a name="structure-members-are-not-sorted-according-to-structure-layout"></a>
<h2 id="structure-members-are-not-sorted-according-to-structure-layout">Structure Members Are Not Sorted According to Structure Layout</h2>
<p>By default, structure members are displayed in alphabetic order. To inspect the real layout in memory, deselect <b>Sort Members of Classes and Structs Alphabetically</b> in the context menu in the <b>Locals</b> and <b>Expressions</b> views.</p>
<a name="built-in-debugger-is-slow-during-startup-and-runtime"></a>
<h2 id="built-in-debugger-is-slow-during-startup-and-runtime">Built-in Debugger Is Slow During Startup and Runtime</h2>
<p>The part of the slowness that is related to the loading of debug information is hard to avoid. Another part stems from maintaining breakpoints inside the debugger (under some circumstances all breakpoints need to be inserted and removed again for each step) and the evaluation of expressions after each step. We recommend that you minimize the number of breakpoints and watched expressions.</p>
<a name="debugger-cannot-attach-to-running-process-on-linux"></a>
<h2 id="debugger-cannot-attach-to-running-process-on-linux">Debugger Cannot Attach to Running Process on Linux</h2>
<p>GDB uses <code>ptrace</code> to attach to running processes. Some Linux distributions do not allow this, which stops all attempts to either directly attach to an existing process or use the <b>Run in terminal</b> option in Qt Creator.</p>
<p>The reasons for this are described in <a href="http://wiki.ubuntu.com/SecurityTeam/Roadmap/KernelHardening#ptrace%20Protection">KernelHardening</a>.</p>
<p>However, the usefulness of this security measure seems dubious, because this feature can be easily disabled. With root permissions, you can disable the feature temporarily by writing <code>0</code> into <code>/proc/sys/kernel/yama/ptrace_scope</code> or permanently by changing the value in <code>/etc/sysctl.d/10-ptrace.conf</code>. Even if you do not have elevated permissions, you can disable the feature later by adding a library that calls <code>prctl(0x59616d61, getppid(), 0, 0, 0);</code>, such as the one in <code>$QTCREATORDIR/lib/libptracepreload.so</code> to the LD_PRELOAD environment.</p>
</div>
<!-- @@@creator-troubleshooting-debugging.html -->
<p class="naviNextPrevious footerNavi">
<a class="prevPage" href="creator-qml-debugging-example.html">Debugging a Qt Quick Example Application</a>
<span class="naviSeparator">  &#9702;  </span>
<a class="nextPage" href="creator-analyze-mode.html">Analyzing Code</a>
</p>
        </div>
       </div>
   </div>
   </div>
</div>
<div class="footer">
   <p>
   <acronym title="Copyright">&copy;</acronym> 2019 The Qt Company Ltd.
   Documentation contributions included herein are the copyrights of
   their respective owners.<br>    The documentation provided herein is licensed under the terms of the    <a href="http://www.gnu.org/licenses/fdl.html">GNU Free Documentation    License version 1.3</a> as published by the Free Software Foundation.<br>    Qt and respective logos are trademarks of The Qt Company Ltd.     in Finland and/or other countries worldwide. All other trademarks are property
   of their respective owners. </p>
</div>
</body>
</html>
